package com.zib.bilibili.presenter;

import android.util.Log;

import com.zib.bilibili.base.BasePresenter;
import com.zib.bilibili.bean.GifttopBean;
import com.zib.bilibili.model.ModelFactory;
import com.zib.bilibili.view.IFragment;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * Created by Administrator on 2016/7/7.
 */
public class GiftTopPresenter extends BasePresenter<IFragment> {
    public GiftTopPresenter(int roomid) {
        getGiftTopData(roomid);
    }

    public void getGiftTopData(int roomid) {
        ModelFactory.GiftTopModel().getLiveData(new Callback<GifttopBean>() {
            @Override
            public void onResponse(Call<GifttopBean> call, Response<GifttopBean> response) {
                Log.i("TAG", "---onResponse: ");
                getView().onSuccess(response.body());
            }

            @Override
            public void onFailure(Call<GifttopBean> call, Throwable t) {
                Log.i("TAG", "---onFailure: ");
            }
        }, roomid);
    }
}
